package org.jianghu.fragment.login;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import org.jianghu.R;
import org.jianghu.fragment.regist.RegistFragment;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.x;


/**
 * Created by Gtexpress on 16/12/9.
 */

@ContentView(R.layout.activity_login)
public class Fragment_login extends Fragment {

    private static final String ARG_COLUMN_COUNT = "column-count";

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        /*
            绑定Fragment注解
         */
        return x.view().inject(this, inflater, container);

    }

    public static Fragment_login newInstance() {
        Fragment_login fragment = new Fragment_login();
        return fragment;
    }

    @Event(value = {R.id.btn_login})
    private void clickOnback(View v) {
        switch (v.getId()) {
            case R.id.btn_login:
                FragmentManager fragmentManager = getActivity().getSupportFragmentManager();

                RegistFragment registFragment = new RegistFragment();

                fragmentManager.beginTransaction().add(R.id.fragment_frame_layout, registFragment).commit();
                break;
        }
    }

}
